
package org.movee.spring.data.hugegraph.repository.config;

import org.movee.spring.data.hugegraph.repository.factory.HugeRepositoryFactoryBean;
import org.springframework.context.annotation.ComponentScan.Filter;
import org.springframework.context.annotation.Import;
import org.springframework.data.repository.config.DefaultRepositoryBaseClass;
import org.springframework.data.repository.query.QueryLookupStrategy;
import org.springframework.data.repository.query.QueryLookupStrategy.Key;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Inherited
@Import(HugeRepositoriesRegistrar.class)
public @interface EnableHugeRepositories {

    /**
     * Alias for basePackages.
     */
    String[] value() default {};

    /**
     * Base packages to scan for components with annotations.
     */
    String[] basePackages() default {};

    /**
     * Type-safe version of basePackages.
     */
    Class<?>[] basePackageClasses() default {};

    /**
     * Specifies types for component scan.
     */
    Filter[] includeFilters() default {};

    /**
     * Specifies types for skipping component scan.
     */
    Filter[] excludeFilters() default {};

    /**
     * Specifics the postfix to be used for custom repository implementation class name.
     */
    String repositoryImplementationPostfix() default "Impl";

    /**
     * Configures the repository base class to be used to create repository.
     */
    Class<?> repositoryBaseClass() default DefaultRepositoryBaseClass.class;

    /**
     * Configure the class of repository factory bean.
     */
    Class<?> repositoryFactoryBeanClass() default HugeRepositoryFactoryBean.class;

    /**
     * Returns the key of the {@link QueryLookupStrategy} to be used for lookup queries for query methods. Defaults to
     * {@link Key#CREATE_IF_NOT_FOUND}.
     */
    Key queryLookupStrategy() default Key.CREATE_IF_NOT_FOUND;

    /**
     * Configures the name of the {@link HugeTemplate} bean to be used with the repositories detected.
     */
    String hugeTemplateRef() default "hugeTemplate";

    /**
     * Specific the namedQuery location.
     */
    String namedQueriesLocation() default "";

    /**
     * Configures whether nested repository interface.
     */
    boolean considerNestedRepositories() default false;
}

